package com.itzg.vboxfarm.service.bits;

import org.springframework.context.ApplicationEvent;

import com.itzg.vboxfarm.domain.HostMachine;

public class HostChangedEvent extends ApplicationEvent {
	private static final long serialVersionUID = 1L;
	
	private final HostMachine hostMachine;

	private final Type type;
	
	private String details;
	
	public static enum Type {
		ADDED,
		REMOVED,
		CONNECTED,
		FAILED /* see details for more info */
	}

	public HostChangedEvent(Object source, HostMachine hostMachine, Type type) {
		super(source);
		this.hostMachine = hostMachine;
		this.type = type;
	}
	
	@Override
	public String toString() {
		return HostChangedEvent.class.getSimpleName()+"[hostMachine="+hostMachine+
				", type="+type+
				"]";
	}
	
	public HostMachine getHostMachine() {
		return hostMachine;
	}
	
	public Type getType() {
		return type;
	}

	public String getDetails() {
		return details;
	}

	public void setDetails(String details) {
		this.details = details;
	}
}
